#pragma once

#include "IVertexBuffer.h"


enum EVertexBufferFlags
{
	eVBFlag_Dynamic	= 1,
	eVBFlag_WriteOnly = 2
};

class CVertexBuffer: public IVertexBuffer
{
public:
	CVertexBuffer(uint length, bool dynamic);
	virtual ~CVertexBuffer();

	//	IVertexBuffer
	virtual void*	Lock(uint offset, uint size, EVertexBufferLockType lock_type);
	virtual void	Unlock();
	virtual uint	GetSize() const;

	//---
	operator IDirect3DVertexBuffer9* () const;

private:
	IDirect3DVertexBuffer9* m_pVB;
	void*	m_pLockData;
	uint	m_length;
	bool	m_bDynamic;
};